-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Initial tracing setup (peer deps + utils) #13899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
cc0eef5
to
7f08f16
Compare
|
7f08f16
to
1472161
Compare
6ce43ea
to
293392b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. As discussed on Slack, it might be nice if users had the ability to modify the root span (e.g. via a requestHook
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks a lot for adding this!
Just had a minor concern about performance of dynamically importing @opentelemetry/api
multiple times but I think overall, the implementation is great!
span.recordException({ | ||
name: 'HttpError', | ||
message: error.body.message | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does a HttpError
also have a stack
? If so, would be cool to also record the stack trace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Furthermore, I'm not 100% sure if this applies here but in our SDK, when we capture HttpError
s, we ignore 4xx errors because usually you don't want to record exceptions for bad requests, 404s, etc. Might be worth a thought if they are valuable or too noisy but happy to leave the call up to you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, lemme think about this one -- not sure if we should just exclude all 400s or give users the ability to filter status codes. My initial feeling is just exclude 400s and see if anyone ever asks for the ability to see them
1472161
to
5abdec8
Compare
5abdec8
to
c8c11f9
Compare
Adds
@opentelemetry/api@^1.0.0
as an optional peer dependency of SvelteKit, and adds some utility functions we'll use to add first-party tracing support.As of this PR, adding
@opentelemetry/api
to your project will do nothing.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits